/**
 * @name cfg-edge-gen
 * @id python/cfg-edge-gen
 */

import python
import util


from File f,ControlFlowNode start,ControlFlowNode end,Scope scope,string start_type,string end_type,string start_value,string end_value,string filepath,string start_location,string end_location
where
start.getScope().getEnclosingModule().getFile()=f
and
end=start.getASuccessor()
and
prepare_cfg_node_id(start, start_type, start_value, start_location)
and
prepare_cfg_node_id(end, end_type, end_value, end_location)
and
filepath=f.getAbsolutePath()
and
isSource(f)
and
scope=start.getScope()
select start,end,start_type,start_value,end_type,end_value,scope,filepath,start_location,end_location


// from File f,ControlFlowNode parent,ControlFlowNode child,BasicBlock basicBlock,string filepath,string location
// where
// parent.getScope().getEnclosingModule().getFile()=f
// and
// (child=parent.getASuccessor() or child.isEntryNode())
// and
// location=getLocText(child.getLocation())
// and
// filepath=f.getAbsolutePath()
// and
// isSource(f)
// and
// basicBlock.contains(child)
// select parent,child,basicBlock,filepath,location